home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / TShare.Frm < prev    next >
Text File  |  1997-06-14  |  3KB  |  117 lines

  1. VERSION 5.00
  2. Begin VB.Form FTestSharedMemory 
  3.    Caption         =   "Test Shared Memory"
  4.    ClientHeight    =   1530
  5.    ClientLeft      =   1560
  6.    ClientTop       =   2070
  7.    ClientWidth     =   3840
  8.    FillColor       =   &H00000080&
  9.    FillStyle       =   7  'Diagonal Cross
  10.    BeginProperty Font 
  11.       Name            =   "Times New Roman"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   -1  'True
  18.    EndProperty
  19.    Icon            =   "TShare.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   1530
  22.    ScaleWidth      =   3840
  23.    Begin VB.CommandButton cmdGet 
  24.       Caption         =   "&Get String"
  25.       BeginProperty Font 
  26.          Name            =   "MS Sans Serif"
  27.          Size            =   8.25
  28.          Charset         =   0
  29.          Weight          =   400
  30.          Underline       =   0   'False
  31.          Italic          =   0   'False
  32.          Strikethrough   =   0   'False
  33.       EndProperty
  34.       Height          =   375
  35.       Left            =   2364
  36.       TabIndex        =   3
  37.       Top             =   960
  38.       Width           =   1215
  39.    End
  40.    Begin VB.CommandButton cmdSet 
  41.       Caption         =   "&Set String"
  42.       BeginProperty Font 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   8.25
  45.          Charset         =   0
  46.          Weight          =   400
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   375
  52.       Left            =   210
  53.       TabIndex        =   2
  54.       Top             =   960
  55.       Width           =   1215
  56.    End
  57.    Begin VB.TextBox txtShare 
  58.       BeginProperty Font 
  59.          Name            =   "Times New Roman"
  60.          Size            =   8.25
  61.          Charset         =   0
  62.          Weight          =   400
  63.          Underline       =   0   'False
  64.          Italic          =   0   'False
  65.          Strikethrough   =   0   'False
  66.       EndProperty
  67.       Height          =   375
  68.       Left            =   210
  69.       TabIndex        =   0
  70.       Top             =   480
  71.       Width           =   3375
  72.    End
  73.    Begin VB.Label lbl 
  74.       Caption         =   "Shared String:"
  75.       BeginProperty Font 
  76.          Name            =   "MS Sans Serif"
  77.          Size            =   8.25
  78.          Charset         =   0
  79.          Weight          =   400
  80.          Underline       =   0   'False
  81.          Italic          =   0   'False
  82.          Strikethrough   =   0   'False
  83.       EndProperty
  84.       Height          =   252
  85.       Left            =   228
  86.       TabIndex        =   1
  87.       Top             =   240
  88.       Width           =   1692
  89.    End
  90. End
  91. Attribute VB_Name = "FTestSharedMemory"
  92. Attribute VB_GlobalNameSpace = False
  93. Attribute VB_Creatable = False
  94. Attribute VB_PredeclaredId = True
  95. Attribute VB_Exposed = False
  96. Option Explicit
  97.  
  98. Private ss As New CSharedString
  99.  
  100. Private Sub Form_Load()
  101.     ss.Create "MyShare"
  102.     If ss = sEmpty Then
  103.         ss = "Hello from the Creator"
  104.     End If
  105.     txtShare = ss
  106. End Sub
  107.  
  108. Private Sub cmdSet_Click()
  109.     ss = txtShare
  110. End Sub
  111.  
  112. Private Sub cmdGet_Click()
  113.     txtShare = ss
  114. End Sub
  115.  
  116.  
  117.